// import { useState } from 'react'
const Son = (props) => {
    return <div>
        <ul>
            {
                props.nav.map((item, index) => {
                    return <li key={index}>
                        {item.name}
                        {/* 递归必须要有条件控制开关 */}
                        {item.children && <Son nav={item.children}>
                            {item.children}
                        </Son>}
                    </li>
                })
            }
        </ul>
    </div>
}
export default Son


